public class d5Test {
    public static void main(String[] args) {
        int[] arr = {1,2,3,4,5};
//        System.out.println(arr[0]); // 根据索引值取值
//        arr[2] = 66; // 索引赋值
//        System.out.println(arr[2]);

//        for (int i = 0; i < arr.length; i++) { // 数组遍历
//            System.out.println(arr[i]);
//        }
        int f = 0;
        for (int i = 0; i < arr.length; i++) {
            int num =  arr[i];
            if(num%2==0){
                f+=num;
            }
        }
        System.out.println(f);

    }
}
